
class A():
    pass

class B():
    pass

a = A()
a.name = 'xiaoming'
b = 'name'
print(a.name)
# 获取对象中指定属性
print(getattr(a, b))
# 判断对象是否包含对应的属性
print(hasattr(a, b))
# 设置对象中指定的属性
setattr(a, 'age', 18)
print(isinstance(a, A))
print(isinstance(a, B))


